package com.itheima.service.mongo.SoulTestImpl;/*
 * @author  xs
 * @date 2022/1/16 20:04
 * @Version  1.0
 * */

import com.itheima.domain.SoulTest.QuestionNaire;
import com.itheima.domain.SoulTest.WJQuestion;
import com.itheima.domain.db.Question;
import com.itheima.domain.vo.PageBeanVo;
import com.itheima.service.SoulTest.SoulManagerService;
import org.apache.dubbo.config.annotation.DubboService;
import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;

import java.util.List;

@DubboService
public class SoulManagerServiceImpl implements SoulManagerService {
@Autowired

private MongoTemplate mongoTemplate;

    @Override
    public QuestionNaire findByIdQuestion(ObjectId id) {

        QuestionNaire questionNaire = mongoTemplate.findById(id, QuestionNaire.class);

        return questionNaire;
    }

    @Override
    public List<WJQuestion> findAllQuestion() {
        List<WJQuestion> all = mongoTemplate.findAll(WJQuestion.class);
        return all;
    }


}
